<script type="text/javascript" src="__PUBLIC__/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery.validate.min.js"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/form_v.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/uploadify/uploadify.css">

<style>
    input.error { border: 1px solid red; }
</style>
<h1 class="sysPageHead">
    <span class="sysPageDot"><img src="__PUBLIC__/images/sysListIcon3.png"><span class="textHide">.</span></span>
    广告主信息
</h1>

<div class="iotSysmCon" style="background:#fff">
    <!--  -->
    <form method="post" action="{$baseUrl}/Admin/Advertisers/store" id="addAdvertisingForm" class="cmxform">
        <div class="reportCon picRelate ">
            <div class="reportBody">

                <div class="reportList"><span class="reportTit">广告主名称：</span><input type="text" class="inp" name="username" placeholder="请输入广告主名称" title="请输入广告主名称" required></div>
                <div class="reportList"><span class="reportTit">联系电话：</span><input type="text" class="inp" name="phone" placeholder="请输入联系电话" title="请输入联系电话" required></div>
                <div class="reportList"><span class="reportTit">邮箱：</span><input type="text" class="inp" name="email" placeholder="请输入邮箱" title="请输入邮箱" required></div>
                <div class="reportList"><span class="reportTit">qq：</span><input type="text" class="inp" name="qq" placeholder="请输入qq" title="请输入qq" required></div>
                <div class="reportList"><span class="reportTit">财务信息：</span><input type="text" class="inp" name="financial_information" placeholder="请输入财务信息" title="请输入财务信息" required></div>
                <div class="reportList"><span class="reportTit">注册人信息：</span><input type="text" class="inp" name="registrant_information" placeholder="请输入注册人信息" title="请输入注册人信息" required></div>

                <div class="reportList">
                    <p class="subBtn" style="margin-top:15px;padding-left:155px">
                        <input type="submit" value="提交" class="modifyBtn">
                    </p>
                </div>

            </div>
        </div>
    </form>
</div>


<script type="text/javascript">
    <?php $timestamp = time();?>
    $(function() {
        //广告主网站logo
        $('#file_upload').uploadify({
            //'debug' : true,
            'buttonText' : '选择文件',
            'formData'     : {
                'timestamp' : '<?php echo $timestamp;?>',
                'token'     : '<?php echo md5("unique_salt" . $timestamp);?>'
            },
            'swf'      : '__PUBLIC__/uploadify/uploadify.swf',
            'uploader' : '{$baseUrl}/EnterpriseSys/File/fileUpload/',
            'onUploadSuccess' : function(file, data, response) {

                var jsonObj = JSON.parse(data) ;
                var destFile = jsonObj.destFile;

                var fileItem = document.createElement('p');

                var fileEl = document.createElement('img');

                var fileInput = document.createElement('input');

                var fileCancel = document.createElement('span');


                $(fileEl).text(destFile.slice(-15));
                $(fileEl).attr('src', '__ROOT__'+destFile);
                $(fileEl).attr('target', '_blank');
                $(fileEl).css('margin-right', '10px');

                $(fileInput).attr('type','hidden');
                $(fileInput).attr('name','logo');

                $(fileCancel).text('删除图片');

                $(fileCancel).click(function(){
                    $(this).closest('p').remove();
                })

                $(fileInput).val(destFile);

                $(fileItem).append(fileEl);

                $(fileItem).append(fileInput);

                $(fileItem).append(fileCancel);

                $(fileCancel).before('<br />');

                $('#file_list').append(fileItem);

            }

        });
        //介绍图片
        $('#introduce_picture_upload').uploadify({
            //'debug' : true,
            'buttonText' : '选择文件',
            'formData'     : {
                'timestamp' : '<?php echo $timestamp;?>',
                'token'     : '<?php echo md5("unique_salt" . $timestamp);?>'
            },
            'swf'      : '__PUBLIC__/uploadify/uploadify.swf',
            'uploader' : '{$baseUrl}/EnterpriseSys/File/fileUpload/',
            'onUploadSuccess' : function(file, data, response) {

                var jsonObj = JSON.parse(data) ;
                var destFile = jsonObj.destFile;

                var fileItem = document.createElement('p');

                var fileEl = document.createElement('img');

                var fileInput = document.createElement('input');

                var fileCancel = document.createElement('span');


                $(fileEl).text(destFile.slice(-15));
                $(fileEl).attr('src', '__ROOT__'+destFile);
                $(fileEl).attr('target', '_blank');
                $(fileEl).css('margin-right', '10px');

                $(fileInput).attr('type','hidden');
                $(fileInput).attr('name','introduce_picture[]');

                $(fileCancel).text('删除图片');

                $(fileCancel).click(function(){
                    $(this).closest('p').remove();
                });

                $(fileInput).val(destFile);

                $(fileItem).append(fileEl);

                $(fileItem).append(fileInput);

                $(fileItem).append(fileCancel);

                $(fileCancel).before('<br />');

                $('#introduce_picture').append(fileItem);

            }

        });

        //体验攻略每步图片



        //验证表单
        $("#addAdvertisingForm").validate();
    });

</script>